class Solution:
    def isPalindrome(self, x: int) -> bool:
        if x < 0:
            return False
        x = str(x)
        num = len(x) 
        forward = x[:int(num/2)]
        back = x[int(num/2):][::-1] if num % 2 == 0 else x[int(num/2) + 1:][::-1]
        if forward == back:
            return True
        else:
            return False


class Solution:
    def isPalindrome(self, x: int) -> bool:
        if x < 0:
            return False
        cur = 0
        num = x
        while num != 0:
            cur = cur * 10 + num % 10
            num = int(num/10)
        if cur == x:
            return True 
        else:
            return False